<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Hellword.html</title>
    <script type="text/javascript" src="../assets/js/vue.js"></script>
</head>
<body>
<h1>helloWorld</h1>
<hr>
<div id="app">
    本场比赛得分： {{count}}<br/>
    <button v-on:click="jiafen">加分</button>
    <button v-on:click="jianfen">减分</button>

    <input type="text" v-on:keyup.enter="onEnter" v-model="secondCount">
</div>
<script type="text/javascript">
    var app=new Vue({
        el:'#app',
        data:{
            count:1,
            secondCount:0
        },
        methods:{
            jiafen:function(){
                this.count++;
            },
            jianfen:function(){
                this.count--;
            },
            onEnter:function(){
                debugger
                this.count=this.count+parseInt(this.secondCount);
            }
        }
    })
</script>
</body>
</html>